﻿<%@ WebHandler Language="C#" Class="isLogin" %>

using System;
using System.Web;
using System.Web.SessionState;
using OneshoppingWeb;
using OneShoppingUtility;
using OneShoppingDAL;
using OneShoppingBLL;
using OneShoppingModel;

public class isLogin : IHttpHandler, IRequiresSessionState
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        try
        {
            SystemUser sysUser = (SystemUser)context.Session["user"];
            if (sysUser != null)
            {
                context.Response.Write( UtilityJson.ResEntityToJson((int)Protocol_user.ALREADY_LOG,sysUser));//已登入
            }
            else {
                context.Response.Write(UtilityJson.ResultToJson((int)Protocol_user.NOT_LOG));//没有登入
            }
        }
        catch
        {
            context.Response.Write(UtilityJson.ResultToJson((int)Protocol_user.NOT_LOG));//没有登入
        }

    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}